import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Task {

    public static void main(String[] args) {
        String data = "来黑马程序员学习Java，\n" +
                "电话：18512516758，18512508907\n" +
                "或者联系邮箱： boniu@itcast.cn\n" +
                "座机电话：01036517895，010-98951256\n" +
                "邮箱：bozai@itcast.cn，\n" +
                "邮箱2：dlei0009@163.com，\n" +
                "热线电话：400-618-9090 ，400-618-4000，\n" +
                "4006184000，4006189090\n";

        extractInfo(data);
    }

    static String regex = "(\\w{1,}@\\w{2,10}(\\.\\w{2,10}){1,2})|" +
            "(1[3-9]\\d{9})|" +
            "(0\\d{2,5}-?\\d{5,15})|" +
            "400-?\\d{3,8}-?\\d{3,8}";
    
    public static void extractInfo(String data) {
        Pattern pattern = Pattern.compile(regex);

        Matcher matcher = pattern.matcher(data);

        while (matcher.find()) {
            System.out.println(matcher.group());
        }
    }

}